home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch20 / 20fig14.wrl < prev    next >
Text File  |  1996-09-23  |  1KB  |  54 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Animated sunlight
  8.         DEF SunLight DirectionalLight {
  9.             direction  0.8 -0.2 -0.2
  10.             intensity 1.0
  11.             ambientIntensity 0.5
  12.             color 1.0 0.6 0.0
  13.         },
  14.     # Animation clock
  15.         DEF Clock TimeSensor {
  16.             cycleInterval 10.0
  17.             loop TRUE
  18.         },
  19.     # Animation directions
  20.         DEF LightDirection PositionInterpolator {
  21.             key [ 0.0, 0.5, 1.0 ]
  22.             keyValue [ 0.8 -0.2 -0.2, 0.0 -1.0 -0.2, -0.8 -0.2, -0.2 ]
  23.         },
  24.     # Animation colors and ambient intensity
  25.         DEF LightColor ColorInterpolator {
  26.             key [ 0.0, 0.5, 1.0 ]
  27.             keyValue [ 1.0 0.6 0.0, 1.0 0.9 0.7, 1.0 0.3 0.1 ]
  28.         },
  29.         DEF LightAmbient ScalarInterpolator {
  30.             key [ 0.0, 0.5, 1.0 ]
  31.             keyValue [ 0.3, 0.7, 0.2 ]
  32.         },
  33.     # Vaulted ceiling and columns
  34.         Inline {
  35.             url "vaulted.wrl"
  36.             bboxCenter 0.0 1.0 0.0
  37.             bboxSize   6.0 2.0 6.0
  38.         },
  39.     # Floor
  40.         Shape {
  41.             appearance Appearance {
  42.                 material Material { }
  43.             }
  44.             geometry Box { size 16.0 0.01 16.0 }
  45.         }
  46.     ]
  47. }
  48. ROUTE Clock.fraction_changed       TO LightDirection.set_fraction
  49. ROUTE Clock.fraction_changed       TO LightColor.set_fraction
  50. ROUTE Clock.fraction_changed       TO LightAmbient.set_fraction
  51. ROUTE LightDirection.value_changed TO SunLight.set_direction
  52. ROUTE LightColor.value_changed     TO SunLight.set_color
  53. ROUTE LightAmbient.value_changed   TO SunLight.set_ambientIntensity
  54.